package com.example.smartpark.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.smartpark.model.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * 用户Mapper接口
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {

    /**
     * 更新最后登录时间
     *
     * @param userId 用户ID
     * @return 影响的行数
     */
    @Update("UPDATE user SET last_login = NOW() WHERE id = #{userId}")
    int updateLastLogin(@Param("userId") Integer userId);
} 